package helper;

public enum Weekday {
	MONDAY("Montag"),
    TUESDAY("Dienstag"),
    WEDNESDAY("Mittwoch"),
    THURSDAY("Donnerstag"),
    FRIDAY("Freitag"),
    SATURDAY("Samstag"),
    SUNDAY("Sonntag");
    
    private String weekday;
    
  
    Weekday(String bezeichner)
    {
        this.weekday = bezeichner;
    }
    
    
    public String getWochentagsbezeichnung()
    {
        return this.weekday;
    }
    
    /**
     * Method to get next weekday.
     * @return weekday
     */
    public Weekday next(){  
        int order = this.ordinal();  
        int newSpot = 0;  
        Weekday result = this;  
        if(order == 6){  
            newSpot = 0;  
        } else {  
            newSpot = order + 1;  
        }  
        for(Weekday val : Weekday.values()){  
            if(val.ordinal() == newSpot){  
                result = val;  
            }  
        }  
        return result;  
    }  
}
